#include <stdio.h>

#include "isa.h"


void decode(unsigned int ic, instr* i) {
	i->opcode = ic >> 26;
	i->target = ic & 0b11111111111111111111111111;
	i->imm = ic & 0b1111111111111111;

	i->rs = (ic >> 21) & 0b11111;
	i->rt = (ic >> 16) & 0b11111;
	i->rd = (ic >> 11) & 0b11111;
	i->sh = (ic >> 6) & 0b11111;
	i->fn = ic & 0b111111;
}
